﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace HospitalCaseScan
{
    public partial class frmCheckOut : Form
    {
        public frmCheckOut()
        {
            InitializeComponent();
        }

        public string strCheckType;
        public frmCheckOut(string type)
        {
            InitializeComponent();
            strCheckType = type;
            if (strCheckType == "CheckIn")
            {
                btnConfirm.Text = "确认归还";
            }
            if (strCheckType == "CheckOut")
            {
                btnConfirm.Text = "确认借出";
            }
        }

        private void btnChangeToManually_Click(object sender, EventArgs e)
        {
            txtNumberCheck.ReadOnly = false;
        }     

        private void btnScan_Click(object sender, EventArgs e)
        {
            txtNumberCheck.Text = "0010023123";
            txtPatientId.Text = "001002312";
            txtSequence.Text = "3";
            txtPName.Text = "病人A";
            txtDEPT_ADMISSION_TO.Text = "心脑血管科";
            txtDIRECTOR.Text = "高主任";
            txtATTENDING_DOCTOR.Text = "医生A";
            txtDOCTOR_IN_CHARGE.Text = "医生D";
            txtPATIENT_CLASS.Text = "入院方式A";
            txtADMISSION_DATE_TIME.Text = "2012-05-01";
            txtDISCHARGE_DISPOSITION.Text = "出院方式A";
            txtDEPT_DISCHARGE_FROM.Text = "心脑血管科";
            txtDISCHARGE_DATE_TIME.Text = "2012-06-01";
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnConfirm_Click(object sender, EventArgs e)
        {
            if (strCheckType == "CheckIn")
            {
                MessageBox.Show("病历已经归还！");
                this.Close();
            }
            if (strCheckType == "CheckOut")
            {
                MessageBox.Show("病历已经借出！");
                this.Close();
            }
        }
        
    }
}
